#! /usr/bin/python
# encoding=utf-8
# Created by Fenglu Niu on 2025/4/30 11:40
import json

from fastapi import APIRouter

from api import R
from common.llm import LLM

router = APIRouter(prefix='/ai', tags=["ai"])

@router.get('/get_agent')
async def get_agent(query: str):
    if not query:
        return R.fail(msg='用户输入不能为空')
    llm = LLM(temperature=1.0)
    agents = llm.dispatch_agent(query)
    return R.ok(data=agents)